package _10_i;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @author ：Rwto
 * @date ：Created in 2021/7/8 14:40
 * @description：
 *
 */
public class Solution02 {
    private Map<Integer,Integer> map = new HashMap();

    public int fib(int n){
        if(map.containsKey(n)){
            return map.get(n);
        }
        if(n<0) return -1;
        if(n==1) return 1;
        if(n==0) return 0;

        int num = (fib(n-1)+fib(n-2))%1000000007;
        map.put(n,num);
        return num;
    }

    public static void main(String[] args) {


        Scanner sca = new Scanner(System.in);
        while(true){

            int num = sca.nextInt();
            if(num<0)break;
            System.out.println(new Solution02().fib(num));
        }
    }
}
